package com.zlkj.pro.modular.admin.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import com.zlkj.pro.modular.admin.model.dto.ConfigDTO;
import com.zlkj.pro.modular.admin.service.ConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.zlkj.pro.core.consts.ProjectConstants.BACKSTAGE_API_PREFIX;

@Slf4j
@RestController
@RequiredArgsConstructor
@ApiResource(name = "系统配置", path = BACKSTAGE_API_PREFIX + "/sysConfig")
public class ConfigAdminController {
    @Resource
    private ConfigService sysConfigService;

    @PostResource(name = "修改系统配置状态", path = "/edit")
    public ResponseData edit(@RequestBody ConfigDTO dto){
        return new SuccessResponseData(sysConfigService.edit(dto));
    }
}
